/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.senior.english.rowmapper;


import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.senior.english.model.UserModel;

/**
 *
 * @author ngoc.phan
 */

public class UserRowMapper implements RowMapper<UserModel>{

//    private SimpleJdbcTemplate jdbctemplate;
//
//    public UserRowMapper() {
//    }
//
//    public UserRowMapper(SimpleJdbcTemplate jdbctemplate) {
//        this.jdbctemplate = jdbctemplate;
//    }

    public UserModel mapRow(ResultSet rs, int rowNum) throws SQLException {
        
        UserModel user = new UserModel();
        user.setUser_name(rs.getString("user_name"));
        user.setPassword(rs.getString("password"));
        
        return user;
    }
}
